//
//  SelectedMoreSecData.m
//  ZCooking
//
//  Created by LL.F on 16/09/12
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "SelectedMoreSecData.h"
#import "SelectedMoreComment.h"
#import "SeclectedMoreLike.h"
#import "SelectedMoreTopics.h"

@implementation SelectedMoreSecData

+ (NSDictionary *)objectClassInArray{
    return @{@"comment" : [SelectedMoreComment class], @"like" : [SeclectedMoreLike class], @"topics" : [SelectedMoreTopics class]};
}
- (void)setValue:(id)value forKey:(NSString *)key
{
    
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"topics"]) {
        NSMutableArray<SelectedMoreTopics *>  *topicsArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            SelectedMoreTopics *data = [SelectedMoreTopics modelWithDic:dic];
            [topicsArray addObject:data];
        }
        _topics = topicsArray;
    }
    if ([key isEqualToString:@"comment"]) {
        NSMutableArray<SelectedMoreComment *>  *commentArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            SelectedMoreComment *data = [SelectedMoreComment modelWithDic:dic];
            [commentArray addObject:data];
        }
        _comment = commentArray;
    }
    if ([key isEqualToString:@"like"]) {
        NSMutableArray<SeclectedMoreLike *>  *likeArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            SeclectedMoreLike *data = [SeclectedMoreLike modelWithDic:dic];
            [likeArray addObject:data];
        }
        _like = likeArray;
    }
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
    if ([key isEqualToString:@"id"]) {
        _id_Data = value;
    } if ([key isEqualToString:@"description"]) {
        _description_Data = value;
    }
}

@end
